#include <stdio.h>
#define A 11
int a[3],i,sum=0;
	char c;
int main()
{	
    
	printf("Please enter three card numbers: \n");
    while(c!= EOF)
{
    for (i=0;i<3;i++)
	{
		sum=0;
		scanf("%d",&a[i]); 
		if( a[i]==11 ||a[i]==12 ||a[i]==13 )
		a[i]=10;
	    if(a[i]==1)
		a[i]=A;
    }
    sum = a[0]+a[1]+a[2];
    if(sum<=21)
    {
	  printf("The scores are: %d",sum);
    }
	else 
	{
		for(i=0;i<3;i++)
		{
			if(a[i]==11)
			sum-=10;
			if(sum<=21)
			break;
			else continue;
		} 
	    printf("The scores are: %d",sum);
	}
	printf("\nIf you want to stop,press Ctrl+z;if you want to continue,press entet and then to continue.");
	scanf("%c",&c);
}
	return 0;
} 
